<template>
  <div class="form_report">
    <el-button @click="exportPdf" class="pdfBtn" v-show="!isLoading"
      >导出PDF</el-button
    >
    <div id="pdfDom1">
      <factory></factory>
    </div>
  </div>
</template>
<script>
import { setTimeout } from "timers";
import factory from "./module/factory";
export default {
  components: {
    factory,
  },
  data() {
    return {
      fileName1: "工厂能源分析报告1-1",
      fileName2: "工厂能源分析报告1-2",
      isLoading: true,
    };
  },
  async created() {},
  mounted() {
    // this.$nextTick(() => {
    //   setTimeout(() => {
    //     this.isLoading = false;
    //     this.getPdf("pdfDom1", this.fileName1, false);
    //     this.getPdf("pdfDom2", this.fileName2, true);
    //   }, 120000);
    // });
  },
  methods: {
    exportPdf() {
      this.getPdf("pdfDom1", this.fileName1, false);
      this.getPdf("pdfDom2", this.fileName2, true);
    },
    goTopFn() {
      document.body.scrollTop = 0;
      document.documentElement.scrollTop = 0;
    },
  },
};
</script>
<style lang="scss" scoped>
.pdfBtn {
  position: fixed;
  right: 20px;
  top: 10px;
}
</style>
